package easy;

public class Solution_2068 {

    public boolean checkAlmostEquivalent(String word1, String word2) {
        int[] array = new int[26];
        for (int i = 0; i < word1.length(); i++) {
            array[word1.charAt(i) - 'a']++;
        }
        for (int i = 0; i < word2.length(); i++) {
            array[word2.charAt(i) - 'a']--;
        }
        for (int count : array) {
            if (count > 3 || count < -3) {
                return false;
            }
        }
        return true;
    }
}
